package com.wz.dhs.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@ApiModel("注册参数")
public class RegisterDTO {

    @NotBlank(message = "手机号不能为空")
    @ApiModelProperty("手机号")
    @Pattern(regexp = "\\d{11}")
    private String phone;

    //@NotBlank(message = "用户名不能为空")
    //@Pattern(regexp = "(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{5,20}",message = "用户名需要由5~10位英文加数字组成")
    private String username;

    @Pattern(regexp = "^(?=.*[a-zA-Z\\d]).{6,12}$",message = "密码必须由英文或者数字组成，并且长度在6-12个字符")
    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("密码")
    private String password;

    @NotBlank(message = "重复密码不能为空")
    @ApiModelProperty("重复密码")
    @Pattern(regexp = "^(?=.*[a-zA-Z\\d]).{6,12}$",message = "密码必须由英文或者数字组成，并且长度在6-12个字符")
    private String repeatPassword;

    @NotBlank(message = "验证码不能为空")
    @ApiModelProperty("验证码")
    private String validCode;





}
